<?php
/**
 * 基础接口组，比如获取下级节点人
 */
Route::group(
    [
        'prefix' => 'baseapi',
        'namespace' => 'Summer\Hjd\Http\Controllers',
    ],
    function () {
        Route::get(
            'orgchart/tuijianchildren/{nid?}',
            'OrgChartController@tuijianchildren'
        )->name('baseapi.orgchart.tuijianchildren');
    }
);
//hjd 通用接口
Route::group(
    [
        'middleware' => 'api',
        'prefix' => 'api/hjd',
        'namespace' => 'Summer\Hjd\Http\Controllers',
    ],
    function () {
        //不需要登录到接口,原则是和用户无关到信息都不加auth
        //【设置】热更新
        Route::post(
            'setting/hot',
            'SettingController@hot'
        )->name('api.hjd.setting.hot');

        //【文章】文章列表
        Route::post(
            'article/index',
            'ArticleController@index'
        )->name('api.hjd.article.index');
        //【文章】文章详情
        Route::post(
            'article/preview',
            'ArticleController@preview'
        )->name('api.hjd.article.preview');

        //【用户】找回密码
        Route::post(
            'user/forgotPwd',
            'UserController@forgotPwd'
        )->name('api.hjd.user.forgotPwd');
        //【用户】短信登录
        Route::post(
            'user/smsLogin',
            'UserController@smsLogin'
        )->name('api.hjd.user.smsLogin');
        //需要登录次能显示
        Route::middleware(['Summer\Hub\Http\Middleware\HubJwtAuthMiddleware'])->group(
            function () {
                //【分享】增加分享记录
                Route::post(
                    'share/create',
                    'ShareController@create'
                )->name('api.hjd.share.create');
                //【分享】我的记录
                Route::post(
                    'share/index',
                    'ShareController@index'
                )->name('api.hjd.share.index');

                //【用户】我的推广
                Route::post(
                    'user/myTeam',
                    'UserController@myTeam'
                )->name('api.hjd.user.myTeam');

                //【用户】我的推广
                Route::post(
                    'user/myShare',
                    'UserController@myShare'
                )->name('api.hjd.user.myShare');

                //【奖金】奖金记录
                Route::post(
                    'bonusRecord/index',
                    'BonusRecordController@index'
                )->name('api.hjd.bonusRecord.index');
                //【财务】财务流水
                Route::post(
                    'detailed/index',
                    'DetailedController@index'
                )->name('api.hjd.detailed.index');

                //【留言】意见反馈
                Route::post(
                    'message/create',
                    'MessageController@create'
                )->name('api.hjd.message.create');

                //【用户】收款信息
                Route::post(
                    'user/bankInfo',
                    'UserController@bankInfo'
                )->name('api.hjd.user.bankInfo');
                //【用户】修改收款信息
                Route::post(
                    'user/updateBank',
                    'UserController@updateBank'
                )->name('api.hjd.user.updateBank');

                //【用户】修改密码
                Route::post(
                    'user/updatePwd',
                    'UserController@updatePwd'
                )->name('api.hjd.user.updatePwd');
                //【用户】绑定更换手机号
                Route::post(
                    'user/bindMobile',
                    'UserController@bindMobile'
                )->name('api.hjd.user.bindMobile');
                //【用户】用户团队
                Route::post(
                    'user/userTeam',
                    'UserController@userTeam'
                )->name('api.hjd.user.userTeam');
                //【用户】用户信息
                Route::post(
                    'user/index',
                    'UserController@index'
                )->name('api.hjd.user.index');
                //【用户】修改信息
                Route::post(
                    'user/update',
                    'UserController@update'
                )->name('api.hjd.user.update');
                //【用户】第三方绑定信息
                Route::post(
                    'user/thirdOauthInfo',
                    'UserController@thirdOauthInfo'
                )->name('api.hjd.user.thirdOauthInfo');
                //【用户】退出登录
                Route::post(
                    'user/logout',
                    'UserController@logout'
                )->name('api.hjd.user.logout');

                //【提现】提现规则
                Route::post(
                    'wdRule/index',
                    'WdRuleController@index'
                )->name('api.hjd.wdRule.index');
                //【提现】提现提交
                Route::post(
                    'wdRecord/create',
                    'WdRecordController@create'
                )->name('api.hjd.wdRecord.create');
                //【提现】提现记录
                Route::post(
                    'wdRecord/index',
                    'WdRecordController@index'
                )->name('api.hjd.wdRecord.index');
                //【转账】转账规则
                Route::post(
                    'tfRule/index',
                    'TfRuleController@index'
                )->name('api.hjd.tfRule.index');
                //【转账】转账提交
                Route::post(
                    'tfRecord/create',
                    'TfRecordController@create'
                )->name('api.hjd.tfRecord.create');
                //【转账】转账记录
                Route::post(
                    'tfRecord/index',
                    'TfRecordController@index'
                )->name('api.hjd.tfRecord.index');
                //【充值】充值规则
                Route::post(
                    'rgRule/index',
                    'RgRuleController@index'
                )->name('api.hjd.rgRule.index');
                //【充值】充值提交
                Route::post(
                    'rgRecord/create',
                    'RgRecordController@create'
                )->name('api.hjd.rgRecord.create');
                //【充值】充值记录
                Route::post(
                    'rgRecord/index',
                    'RgRecordController@index'
                )->name('api.hjd.rgRecord.index');
            }
        );

    }
);



